package com.Cfeng.XiaohuanChat.service.impl;

import com.Cfeng.XiaohuanChat.entity.ChatUserRole;
import com.Cfeng.XiaohuanChat.repository.ChatUserRoleRepository;
import com.Cfeng.XiaohuanChat.service.ChatRoleService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author Cfeng
 * @date 2022/8/7
 */

@Service
@RequiredArgsConstructor
public class ChatRoleServiceImpl implements ChatRoleService {

    private final ChatUserRoleRepository roleRepository;

    @Override
    public ChatUserRole addRole(ChatUserRole chatUserRole) {
        return roleRepository.save(chatUserRole);
    }

    @Override
    public void removeRole(ChatUserRole chatUserRole) {
        roleRepository.delete(chatUserRole);
    }
}
